/*
 * @Author: 2112778581 2112778581@qq.com
 * @Date: 2023-10-17 16:27:42
 * @LastEditors: 2112778581 2112778581@qq.com
 * @LastEditTime: 2023-10-20 10:23:40
 * @FilePath: \cra-front\src\api\content\category.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from '@/api/request'

// 分类列表
export const getCategoryList = (data: any): any => {
  return request.post('/category/findAll', data)
}

// 所有产品分类
// http://localhost:3000/api
export const getAllProdCategoryList = (): any => {
  return request.post('/category/allProdCategory')
}

// 所有新闻分类
export const getAllNewsCategoryList = (): any => {
  return request.post('/category/allNewsCategory')
}

// 编辑分类
export const editCategoryApi = (id: string, data: any): any => {
  return request.post(`/category/${id}`, data)
}
// 新增分类
export const addCategoryApi = (data: any): any => {
  return request.post('/category', data)
}

// 删除分类
export const delCategoryApi = (id: string): any => {
  return request.delete(`/category/${id}`)
}

// 查找单个分类
// export const addNews = (data: any): any => {
//   return request.post('/news', data)
// }
